<template>
  <div>
    <div class="top">
      <el-button type="primary">
        <router-link class="link" to="/addcar">添加</router-link>
      </el-button>
    </div>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="chepai" label="车牌号" width="180" />
      <el-table-column prop="yezhu" label="业主姓名" width="180" />
      <el-table-column prop="leixing" label="车辆类型" />
      <el-table-column prop="xinnengyuan" label="新能源" />
      <el-table-column prop="address" label="操作">
        <template #default="row">
          <el-button @click="handleEdit(row)">编辑</el-button>
          <el-button @click="handleDelete(row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script setup lang="ts">
//一组默认数据
const tableData = [
  {
    date: "2016-05-03",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
];
//结束

//编辑
const handleEdit = (row) => {
  console.log(row);
};
//结束
//删除
const handleDelete = (row) => {
  console.log(row);
};
//结束
</script>

<style scoped>
.top {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  margin-left: 10px;
}
.active-link-active {
  text-decoration: none;
  color: inherit;
}
.link {
  text-decoration: none;
  color: inherit;
}
</style>
